<div class="custom">
    <h1>
        客户管理
    </h1>

    <form class=" form-inline">
        <div class="row">
            <div class="form-group col-md-3">
                <label class="">所属区</label>
                <select class="form-control " ng-model="queryData.address_like">
                    <option value="">-- 选择所在区 --</option>
                    <option value="蜀山区">蜀山区</option>
                    <option value="包河区">包河区</option>
                    <option value="庐阳区">庐阳区</option>
                    <option value="瑶海区">瑶海区</option>
                    <option value="政务区">政务区</option>
                    <option value="经开区">经开区</option>
                    <option value="高新区">高新区</option>
                    <option value="滨湖新区">滨湖新区</option>
                    <option value="新站区">新站区</option>
                </select>
            </div>
            <div class="form-group col-md-3">
                <label class="">客户姓名</label>
                <input type="text" ng-model="queryData.storeName_like" class=" form-control ng-pristine ng-valid ng-touched">
            </div>
            <div class="form-group col-md-3">
                <label class="">销售人员</label>
                <select class="form-control" ng-model="x" ng-options="x.realName for x in seller">
                    <option value="" >选择销售人员</option>
                </select>
            </div>
            <div class="form-group col-md-3" >
                <select class="form-control" ng-model="queryData.hasFirstOrder">
                    <option value="" >请选择订单状态</option>
                    <option value="0" >已下单</option>
                    <option value="1" >未下单</option>
                </select>
                <!--<input type="checkbox" class="checkbox" ng-click="queryData.hasFirstOrder=0" >已下单</input>-->
            </div>
        </div>

        <div class="row">
            <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
                <button type="button" class="btn btn-warning btn-block" ng-click="exportAllGoods(x)">导出客户信息</button>
            </div>

            <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
                <button type="button" class="btn btn-warning btn-block" ng-click="doQuery(x);">查询</button>
            </div>
            <div class="form-group col-md-4"  style="margin-top:10px;margin-bottom:10px;">
                <button type="reset"  class="btn btn-default" ng-click="reset()">重置</button>
            </div>
        </div>
    </form>

    <div class="panel panel-default">
        <div class="panel-heading clearfix">
            客户总数：{{data.totalSize}}  下单客户总数：{{data.otherCount}}
            <div class="btn-group btn-group-sm pull-right" role="group" aria-label="...">
                <a ui-sref="admin.addLineCustomer" class="btn btn-success pull-right">增加客户</a>
            </div>
        </div>

        <table class="table table-bordered panel-body table-condensed ">
            <thead>
            <tr>
                <th >#</th>
                <th >姓名</th>
                <th >所属区</th>
                <th >详细地址</th>
                <th >联系人</th>
                <th >联系人电话</th>
                <th >销售人员</th>
                <th >下单数量</th>
                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in data.resultData">
                <th>
                    {{$index+1}}
                </th>
                <td>{{item.storeName}}</td>
                <td>{{item.address}}</td>
                <td>{{item.addressDetail}}</td>
                <td>{{item.managerName}}</td>
                <td>{{item.phone}}</td>
                <td>{{item.sellerName}}</td>
                <!--//<td>{{item.hasFirstOrder | isFirstBlood}}</td>-->
                <td>{{item.count}}</td>
                <td>
                    <a ui-sref="admin.updateLineCustomer({lineCustomerId:item.customerId})" href="">修改</a>
                    <a ng-click="delLineCustomer(item.customerId,item.customerName)" href="">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
        <div ng-if="!data.resultData" style="text-align: center">
            加载中...
        </div>

        <div class="panel-footer" style="text-align: center;">
            <uib-pagination style="margin:0;" ng-change="pageChanged(data.currentPage)" total-items="data.totalSize" ng-model="data.currentPage"
                            items-per-page="data.pageSize" max-size="5" class="pagination-sm" boundary-links="true"
                            rotate="false"></uib-pagination>
        </div>

    </div>




</div>